<template>
  <div class="box_main">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <el-button style="float: center; padding: 3px 0" type="text"
          >用户登录</el-button
        >
      </div>
      <el-form style="margin-left: 80px">
        <el-col :span="17">
          <el-form-item label="用户名：">
            <input width="120px" value="admin" />
          </el-form-item>
        </el-col>
        <el-col :span="17">
          <el-form-item label="密    码：">
            <input width="120px" type="password" value="111111" />
          </el-form-item>
        </el-col>
        <el-col :span="20">
          <el-form-item>
            <el-button type="primary" @click="login">登录</el-button>
            <el-button type="info">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import { getChildrenPath } from "@/router/indexUtil";

export default {
  methods: {
    login() {
      localStorage.setItem("authorizationpms", "莫等闲，白了少年头，空悲切");
      // console.log(localStorage.getItem("authorizationpms"));
      localStorage.setItem("userId", "518");

      getChildrenPath(this.$apiUrl);
      

      this.$router.push("/defaultpage");
    },
  },
};
</script>

<style>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}

.box-card {
  width: 480px;
  margin: 18% 38%;
  top: 10%;
  left: 50%;
}

* {
  margin: 0px;
  padding: 0px;
}

.box_main {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url(/static/pmsbg.webp);
  background-size: 100%;
  background-repeat: no-repeat;
}
</style>